package vip.xiaozhao.paotui.intf.mapper;

import org.apache.ibatis.annotations.*;
import vip.xiaozhao.paotui.intf.entity.PaotuiWalletAudit;

@Mapper
public interface PaotuiWalletAuditMapper {

    @Select("select * from xzvip_paotui_wallet_audit where id=#{id}")
    PaotuiWalletAudit loadById(int id);

    @Insert("insert into xzvip_paotui_wallet_audit(UserId,WalletId,Amount,Status,`Desc`,AddTime,UserIp)" +
            "values (#{userId},#{walletId},#{amount},#{status},#{desc},now(),#{userIp})")
    @Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
    int insert(PaotuiWalletAudit walletAudit);

    @Update("update xzvip_paotui_wallet_audit set UserId = #{userId},WalletId = #{walletId}," +
            "Amount = #{amount},Status = #{status} ,`Desc` = #{desc} , UpdateTime = now() where id = #{id} ")
    int update(PaotuiWalletAudit walletAudit);
}
